<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
     <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%@include file="publicJSCSS.jsp"%>
<jsp:include page="../HRTWEB/address/show.jsp"></jsp:include>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/HRTWEB/css/buyGift.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/HRTWEB/css/publicCss.css">
<link href="<%=request.getContextPath() %>/HRTWEB/css/bootstrap.min.css" rel="stylesheet" />
<script src="<%=request.getContextPath() %>/HRTWEB/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/HRTWEB/js/buyGift.js"></script>
<script src="<%=request.getContextPath()%>/HRTWEB/js/bootstrap.min.js"></script>
<title>立即购买</title>
</head>
<body>
<%@include file="head.jsp"%>
<div id="publicMain">
    <div class="buyGift-div" onMouseOver="this.style.borderColor='red'" onMouseOut="this.style.borderColor='#CCC'">
	<table class="buyGift-table" cellspacing="0" cellpadding="0" id="addressBookTable">
	    <tr>
            <td class="buyGift-table-bboder">确认收货地址</td>
            <td class="buyGift-table-bboder">管理收货地址</td>
        </tr>
		<c:forEach var="address" items="${addressList}">
	    <tr>
            <td><input type="radio" id="isUse"  name="isUse" addressId="${address.id}"/><span id="province">${address.province}</span></td>
            <td class="buyGift"><button type="button" id="editBtn" data-toggle="modal" memberId="${hrtMember.id}" addressId="${address.id}">修改本地址</button></td>
        </tr>
												
		</c:forEach>
	    <tr>
        	<td class="buyGift" colspan="2">
            	<button type="button" id="addBtn" data-toggle="modal" memberId="${hrtMember.id}">添加新地址</button>
            </td>
        </tr>
	</table>
    </div>
    <div class="buyGift-div" onMouseOver="this.style.borderColor='red'" onMouseOut="this.style.borderColor='#CCC'">
        <table class="buyGift-table" cellspacing="0" cellpadding="0">
            <tr>
                <td colspan="5" class="buyGift-table-trboder">确认订单信息   订单编号：${orderCode}</td>
            </tr>
            <tr class="buyGift-middle">
                <td class="buyGift-table-bboder">礼品</td>
                <td class="buyGift-table-bboder">单价（元）</td>
                <td class="buyGift-table-bboder">数量</td>
                <td class="buyGift-table-bboder">优惠方式</td>
                <td class="buyGift-table-bboder">小计（元）</td>
            </tr>
             <c:forEach var="order" items="${orderDetailList}">
            <tr class="buyGift-middle">
                <td >${order.gdName}</td>
                <td >${order.salePrice}</td>
                <td >${order.total}</td>
                <td ></td>
                <td >${order.summery}</td>
            </tr>
                 </c:forEach>
            
        </table>
    </div>
    <div class="buyGift-div">
        <form action="<%=request.getContextPath()%>/web/orderInfor/save.do" name="webOrderInfo" method="post">
            <!-- 订单基本信息 -->
            <table class="buyGift-table" cellspacing="0" cellpadding="0" style="display:none;">
                <tr>
                	<td><input value="${orderCode}" type="hidden" name="orderCode" id="orderCode"/></td><!-- 订单编号 -->
                    <td><input value="${hrtMember.id}" type="hidden" name="memberId" id="memberId"/></td><!-- 会员ID -->
                    <td><input  type="hidden" name="summery" id="summery" value="${detail.summery}"/></td><!-- 订单金额 -->
                    <td colspan="2"><input type="hidden"  name="postCode" id="postCode" value="${address.postCode}"/></td><!-- 邮政编码 -->
                </tr>
                <tr>
                    <td><input type="hidden"  name="province" id="province" value="${address.province}"/></td><!-- 收货地址 -->
                    <td><input value="${hrtMember.mbrName}" type="hidden"  name="memberName" id="memberName"/></td><!-- 会员名 -->
                    <td colspan="2"><input  type="hidden"  name="receiver" id="receiver" value="${address.receiver}"/></td><!-- 收货人 -->
                </tr>
                <!-- 订单详细信息 -->
                <tr>
                <%int idx=0; %>
				<c:forEach var="gift" items="${giftDetailList}">
                    <td><input value="${gift.giftName}" type="hidden"  name="details[<%=idx%>].giftName" id="giftName"/></td><!-- 礼品名称 -->
                    <td><input value="${gift.giftId}" type="hidden"  name="details[<%=idx%>].giftId" id="giftId"/></td> <!-- 礼品id -->
                    <td colspan="2"><input value="${gift.giftCode}" type="hidden"  name="details[<%=idx%>].giftCode" id="giftCode"/></td><!-- 礼品编号 -->
                     <td><input value="${gift.salePrice}" type="hidden"  name="details[<%=idx%>].salePrice" id="salePrice"/></td><!-- 礼品规格单价 -->
                     <td><input value="${gift.gdCode}" type="hidden"  name="details[<%=idx%>].gdCode" id="gdCode"/></td><!-- 礼品规格编号 -->
                     <td><input value="${gift.gdName}" type="hidden"  name="details[<%=idx%>].gdName" id="gdName"/></td><!-- 礼品规格名称 -->
                     <%idx++; %>
                </c:forEach>
                </tr>
                <tr>
                	<%int idj=0; %>
					<c:forEach var="order" items="${orderDetailList}">
                     <td><input value="${order.summery}" type="hidden"  name="details[<%=idj%>].summery" id="summery"/></td><!-- 总价 -->
                     <td><input value="${order.giftDetailId}" type="hidden"  name="details[<%=idj%>].giftDetailId" id="giftDetailId"/></td><!-- 礼品规格id -->
                     <td><input value="${order.total}" type="hidden"  name="details[<%=idj%>].total" id="total"/></td><!-- 礼品规格数量 -->
                     <%idj++; %>
					</c:forEach>
                </tr>
            </table>
            
      
        <table class="buyGift-table" cellspacing="0" cellpadding="0">
           <tr>
               <td colspan="2" class="buyGift-table-tboder">给卖家留言：
                  <textarea type="text" rows="1" overflow-y="scroll" cols="53" name="note" id="note" style="height:30px;resize:none;"></textarea>
               </td>
               <td class="buyGift-table-tboder">运送方式：</td>
               <td class="buyGift-table-tboder">
                 <input type="radio" id="franking"  name="franking"/>普通配送
                 <select id="commentStatus" class="commentStatus" style="width:100px;height:20px;">
                    <option selected='selected'>快递 免邮</option> 
                    <option value='0'>Ems20.00元</option>  
                    <option value='1'>平邮20.00元</option>
                 </select>
               </td>
               <td class="buyGift-table-tboder">0.00</td>
           </tr>
           <tr>
               <td colspan="3">设置密码锁：<input type="text"  name="OpenPassword" id="OpenPassword"/></td><!-- 密码锁 -->
               <td><input type="radio" id="freightInsurance"  name="freightInsurance"/>购买退货运费险，退货可赔付15元</td>
               <td>1.00</td>
           </tr>
           <tr>
                <td colspan="3" class="buyGift-table-bboder"></td>
                <td class="buyGift-right buyGift-table-bboder">店铺合计(含运费)：</td>
                <td class="buyGift-table-bboder"><span class="buyGift-fontRight">￥128.0</span></td>
            </tr> 
        </table>
        <div class="buyGift-divAdress">
              <p class="buyGift-right">实付款：<span class="buyGift-fontRight">￥128.0</span></p>
              <p class="buyGift-right">送寄至：</p>
              <p class="buyGift-right">收件人：</p>
        </div>
         <div class="buyGift-submitDiv"><button type="submit" class="buyGift-btn">提交订单</button> </div>
         </form>
    </div>
   </div>
<div id="footer" class="footer">
<%@include file="foot.jsp"%> 
</div>
</body>
</html>
